<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>大连交通大学在线服务平台</title>
<link href="../css/bootstrap.min.css" rel="stylesheet" />
<link href="../css/font-awesome.min.css" rel="stylesheet" />
<link href="../css/common.css" rel="stylesheet" />
<link href="../images/favicon.ico" rel="shortcut icon" />
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.js"></script>
<script src="../js/bootstrapValidator.min.js"></script>
<script src="../js/language/zh_CN.js"></script>
<script src="../admin/kindeditor/kindeditor.js"></script>
<script src="../admin/kindeditor/lang/zh_CN.js"></script>
<script src="../js/common.js"></script>
<script>
	function confirmdelete(gid) {
		var r = confirm("您确定要删除这个商品么？")
		if (r == true) {
			window.location.href = "goods_i_delete.do?gid=" + gid + "&uid=${user.uid}";
		}
	}
</script>
</head>
<body>
	<div class="center-block-2">
		<div class="list-group">
			<p class="list-group-item active">
				<img src="../images/ershou.png" width="20px" height="20px" alt="" /> 发布过的二手物品：
			</p>
			<div class="row" style="">
				<c:choose>
					<c:when test="${not empty user_goods_list}">
						<ul class="goods-sm">
							<c:forEach items="${user_goods_list}" var="list" begin="0" end="7">
								<li><img src="../${list.imgurl}" alt="${list.name}" width="150" height="150">
									<p>${list.name}</p>
									<p>
										时间：
										<fmt:formatDate value="${list.createtime}" pattern="yyyy-MM-dd" />
									</p>
									<div class="btn-group">
										<a href="goods_i_update_show.do?gid=${list.gid }" class="btn btn-warning">编辑</a> <a
											href="javascript:confirmdelete(${list.gid})" class="btn btn-danger">删除</a>
									</div></li>
							</c:forEach>
						</ul>
					</c:when>
					<c:otherwise>
						<h3 style="margin-left: 10%">
							您还未发布过商品 请先添加一件！<a href="er-add.jsp" class="btn btn-info">&nbsp;点击添加 </a>
						</h3>
					</c:otherwise>
				</c:choose>
			</div>
		</div>
	</div>
</body>
</html>